import Vue from 'vue'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import './plugins/element.js'
import './assets/css/common.css'
import './router/permission'
import jwtDecode from 'jwt-decode'
import './utils/eventBus'
if(localStorage.getItem('ego')) {
  store.commit('loginModule/updateToken', JSON.parse(localStorage.getItem('ego')).token);
  store.commit('loginModule/updateUsername', jwtDecode(JSON.parse(localStorage.getItem('ego')).token).username);
}

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
